
export const getNowDate = () => {
    var myDate = new Date();
    var year = myDate.getFullYear(); //获取当前年
    var mon = myDate.getMonth() + 1; //获取当前月
    var date = myDate.getDate(); //获取当前日
    var hours = myDate.getHours(); //获取当前小时
    var minutes = myDate.getMinutes(); //获取当前分钟
    var now = `${year}年${mon}月${date}日${hours}时${minutes}分`
    return now;
}

/* 根据浏览器大小推断缩放比例 */
export const getScale = (width = 1920, height = 1080) => {
    let ww = window.innerWidth / width;
    let wh = window.innerHeight / height;
    return ww < wh ? ww : wh;
}

// 监听echarts 窗口变化 使用scale 的echarts不需要
const echartsDom = [];
export const echartsResize = (eDom) => {
    echartsDom.push(eDom);
    window.addEventListener("resize", function () {
        echartsDom.forEach((it) => {
            it.resize();
        })
    });
}


